<template>
	<view class="scroll-view"
	>
		<scroll-view scroll-y 
			:class="styleClass"
			:style="style"
		>
			<slot></slot>
		</scroll-view>
	</view>
</template>

<script setup>
import { computed } from 'vue'

const props = defineProps({
	height: {
		type: String
	},
	hideScroll: {
		type: Boolean,
		default: false
	}
})

const styleClass = computed(() => {
	return {
		['hideScroll']: props.hideScroll
	}
})

const style = computed(() => {
	return {
		...(props.height ? {'height': props.height + 'px'} : {'height': '100%'}),
		'overflow-y': 'auto'
	}
})
</script>

<style lang="less" scoped>
	@import './style/index.less';
</style>